In computer systems, a virtual machine is software that mimics the performance of a hardware device. One example of a virtual machine is a program that allows applications written for x86 format microprocessor (e.g., available from Intel Corporation) to be run on a 68000 format microprocessor (e.g., available from Motorola Corporation). Virtual machine computers, referred to simply as virtual machines hereafter, have been developed recently to provide software that mimics a "complete" computer. One example is the Java.TM. virtual machine introduced by Sun Microsystems, Inc. and available for a variety of computer platforms to run programs written in the Java.TM. virtual machine-based programming language. Such a virtual machine functions as a computer platform that hides the operating system of the underlying hardware computer from applets and applications written in the programming language of the virtual machine.
Virtual machines are commonly associated with stand-alone or client-side computers where the virtual machine operates in conjunction with an operating system or an Internet browser, for example. It will be appreciated, however, that virtual machines may also be operated in conjunction with or on a server computer that serves one or more client computers. The clients may be connected to the server directly or by networked connections. One example of a server virtual machine is the Gemstone/J.TM. 1.0 server virtual machine available from Gemstone Systems, Inc. of Beaverton, Oreg., the assignee of the present invention. Server virtual machines may be used in a variety of applications, including database and transaction applications.
A common characteristic of servers and server applications is concurrent execution of client services on behalf of multiple clients within a single server or server application. While multi-threaded server operating systems and server applications are well known and widely available, server virtual machines are commonly restricted to executing only one workspace at a time. Client virtual machines have the same characteristic. One way in which such a conventional server virtual machine serves its multiple clients is to multiplex multiple client services or transactions onto a single workspace. This results in relatively slow execution of each of the services or deferred execution for selected ones of them. Another way in which such a conventional server virtual machine serves its multiple clients is to launch and run a transactional virtual machine with a workspace for each client service. This results in excessive system memory and processing resources and hence can limit the number of client services that can be provided simultaneously or decrease the speed at which the services are executed.
The present invention includes a virtual machine server that operates in a multi-threaded computer system and selectively launches and operates one or more server virtual machines. Each virtual machine includes multiple threads and can support multiple simultaneous workspaces. Within each workspace, multiple threads are able to access objects simultaneously. Moreover, threads are orthogonal to workspaces so that threads are not locked to particular workspaces, workspaces are not locked to particular threads, and the sizes of the workspaces are configurable to the requirements of the transactions within the workspaces. As a result, virtual machines according to this invention require less system memory and processing resources and hence can serve greater numbers of client services at greater speed than can conventional server virtual machines.
Virtual machines that support multiple workspaces may be utilized in a variety of applications including transactional database applications in which multiple users have access to information (e.g., objects) in one or more shared databases. Such applications typically require that data transactions involving the objects in the shared database be performed reliably so as to maintain the integrity of the objects, which are sometimes called persistent objects.
As another aspect of this invention, multiple temporary objects or views of a persistent object can be open and manipulated simultaneously by different users within different workspaces while the integrity of the persistent objects and the reliability of transactions involving them are maintained. The ability to support multiple simultaneous temporary objects or views of persistent objects is an analog to providing virtual machines that support multiple workspaces. In one implementation, transactional information in the form of a transactional information data structure identifies the object views or temporary objects within a workspace by workspace identifiers, as well as other aspects of the temporary objects. A persistent object transaction method, in the form of a sequence of virtual machine instructions, performs transactions on persistent objects in the virtual machine environment.
Additional objects and advantages of the present invention will be apparent from the detailed description of the preferred embodiment thereof, which proceeds with reference to the accompanying drawings.